<?php
//=======================================
//###################################
// Kayako Web Solutions
//
// Source Copyright 2001-2004 Kayako Infotech Ltd.
// Unauthorized reproduction is not allowed
// License Number: $%LICENSE%$
// $Author: vshoor $ ($Date: 2005/08/07 05:20:29 $)
// $RCSfile: footer.php,v $ : $Revision: 1.13 $ 
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//###################################
//=======================================


if (!defined("INSWIFT")) {
	// File being called directly, end it
	trigger_error("Unable to process $PHP_SELF", E_USER_ERROR);
}

?></td>
                        </tr>
                      </table></td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td align="center" valign="bottom"> <table width="100%"  border="0" cellspacing="0" cellpadding="4">
                  <tr>
                    <td align="left"><hr size="1">
					<?php
					/**
					* Display buttons and hidden fields based on the step, if step is 4 then itterate through pages.
					*/
					if ($_POST["step"] == "0")
					{
						?><input class="inputbutton" type="submit" name="submitbutton" value="I Agree" onfocus="this.blur();"><input type="hidden" name="step" value="1"><?
					} else if ($_POST["step"] == "1" && $_SWIFT["error"] != true && (SETUPTYPE == "Upgrade" || SETUPTYPE == "Impex" || SETUPTYPE == "Modify")) {
						?><input class="inputbutton" type="submit" name="submitbutton" value="Next &raquo;"><input type="hidden" name="step" value="2"><?
					} else if ($_REQUEST["step"] == "2" && $_SWIFT["error"] != true && $_SWIFT["setupfailed"] != true && (SETUPTYPE == "Upgrade" || SETUPTYPE == "Impex" || (SETUPTYPE == "Modify" && $_SWIFT["processbuttons"] == true))) {
						?><input class="inputbutton" type="submit" name="submitbutton" value="Next Step &raquo;"><input type="hidden" name="step" value="2"><input type="hidden" name="product" value="<?php echo $_REQUEST["product"]; ?>"><input type="hidden" name="username" value="<?php echo $_REQUEST["username"]; ?>"><input type="hidden" name="password" value="<?php echo $_REQUEST["password"]; ?>"><input type="hidden" name="page" value="<?php echo $_SWIFT["execpage"]; ?>">
						<?
							if (SETUPTYPE == "Impex")
							{
								?>
								<input type="hidden" name="action" value="<?php echo $_SWIFT["execaction"]; ?>">
								<input type="hidden" name="ticketstartat" value="<?php echo $_SWIFT["ticketstartat"]; ?>">
								<input type="hidden" name="hashfilename" value="<?php echo $_POST["hashfilename"]; ?>">
								<input type="hidden" name="dbhostname" value="<?php echo $_POST["dbhostname"]; ?>">
								<input type="hidden" name="dbname" value="<?php echo $_POST["dbname"]; ?>">
								<input type="hidden" name="dbusername" value="<?php echo $_POST["dbusername"]; ?>">
								<input type="hidden" name="dbpassword" value="<?php echo $_POST["dbpassword"]; ?>">
								<?
							} else if (SETUPTYPE == "Modify") {
								?><input type="hidden" name="action" value="<?php echo $_SWIFT["action"]; ?>"><?
							}
							
					} else if ($_POST["step"] == "1" && $_SWIFT["error"] != true && $_SWIFT["hastables"] == true && SETUPTYPE == "Setup") {
						?><input class="inputbutton" type="submit" name="submitbutton" value="Empty Database">&nbsp;<input class="inputbutton" type="submit" name="submitbutton" value="Continue">&nbsp;<input type="hidden" name="step" value="1"><?php
					} else if ($_POST["step"] == "1" && $_SWIFT["error"] != true && $_SWIFT["hastables"] == false && SETUPTYPE == "Setup") {
						?><input class="inputbutton" type="submit" name="submitbutton" value="Next &raquo;"><input type="hidden" name="step" value="2"><?php
					} else if ($_POST["step"] == "2" && SETUPTYPE == "Setup") {
						?><input class="inputbutton" type="submit" name="submitbutton" value="Start Auto Setup"><input type="hidden" name="step" value="3"><input type="hidden" name="setupmodule" value="core"><input type="hidden" name="page" value="1"><?php
					} else if ($_POST["step"] == "3" && SETUPTYPE == "Setup") {
						// Fun! Fun! All auto setup, should display just the submit button where JS is disabled, if JS is enabled, should disable the submit button and move over to next page automatically.
						if (trim($_SWIFT["execmodule"]) == "")
						{
							// Empty, setup wizard has ended!
							?><input class="inputbuttonred" type="submit" name="submitbutton" value="Settings &raquo;"><input type="hidden" name="step" value="4"><input type="hidden" name="username" value="<?php echo $_POST["username"]; ?>"><input type="hidden" name="fullname" value="<?php echo $_POST["fullname"]; ?>"><input type="hidden" name="email" value="<?php echo $_POST["email"]; ?>"><input type="hidden" name="password" value="<?php echo $_POST["password"]; ?>"><input type="hidden" name="password2" value="<?php echo $_POST["password2"]; ?>"><input type="hidden" name="producturl" value="<?php echo $_POST["producturl"]; ?>"><input type="hidden" name="companyname" value="<?php echo $_POST["companyname"]; ?>"><?php
						} else if ($_SWIFT["setupfailed"] != true) {
							?>
							<input class="inputbutton" type="submit" name="submitbutton" value="Next Step &raquo;"><input type="hidden" name="step" value="3"><input type="hidden" name="username" value="<?php echo $_POST["username"]; ?>"><input type="hidden" name="fullname" value="<?php echo $_POST["fullname"]; ?>"><input type="hidden" name="email" value="<?php echo $_POST["email"];?>"><input type="hidden" name="password" value="<?php echo $_POST["password"]; ?>"><input type="hidden" name="password2" value="<?php echo $_POST["password2"];?>"><input type="hidden" name="producturl" value="<?php echo $_POST["producturl"];?>"><input type="hidden" name="companyname" value="<?php echo $_POST["companyname"];?>"><input type="hidden" name="setupmodule" value="<?php echo $_SWIFT["execmodule"]; ?>"><input type="hidden" name="page" value="<?php echo $_SWIFT["execpage"]; ?>"><?php
						}
					} else if ($_POST["step"] == "4" && SETUPTYPE == "Setup") {
						if ($_SWIFT["setupfailed"] != true) {
							?>
							<input class="inputbuttonred" type="submit" name="submitbutton" value="Templates &raquo;"><input type="hidden" name="step" value="5"><input type="hidden" name="username" value="<?php echo $_POST["username"]; ?>"><input type="hidden" name="fullname" value="<?php echo $_POST["fullname"]; ?>"><input type="hidden" name="email" value="<?php echo $_POST["email"]; ?>"><input type="hidden" name="password" value="<?php echo $_POST["password"]; ?>"><input type="hidden" name="password2" value="<?php echo $_POST["password2"]; ?>"><input type="hidden" name="producturl" value="<?php echo $_POST["producturl"]; ?>"><input type="hidden" name="companyname" value="<?php echo $_POST["companyname"]; ?>"><?php		
						}
					} else if ($_POST["step"] == "5" && SETUPTYPE == "Setup") {
						if ($_SWIFT["setupfailed"] != true)
						{
							?><input class="inputbuttonred" type="submit" name="submitbutton" value="Languages &raquo;"><input type="hidden" name="step" value="6"><input type="hidden" name="username" value="<?php echo $_POST["username"]; ?>"><input type="hidden" name="fullname" value="<?php echo $_POST["fullname"]; ?>"><input type="hidden" name="email" value="<?php echo $_POST["email"]; ?>"><input type="hidden" name="password" value="<?php echo $_POST["password"]; ?>"><input type="hidden" name="password2" value="<?php echo $_POST["password2"]; ?>"><input type="hidden" name="producturl" value="<?php echo $_POST["producturl"]; ?>"><input type="hidden" name="companyname" value="<?php echo $_POST["companyname"]; ?>"><?php	
						}
					} else if ($_POST["step"] == "6" && SETUPTYPE == "Setup") {
						if ($_SWIFT["setupfailed"] != true)
						{
							// Empty, setup wizard has ended!
							?><input class="inputbuttonred" type="submit" name="submitbutton" value="&raquo; Finish &laquo;"><input type="hidden" name="step" value="7"><input type="hidden" name="username" value="<?php echo $_POST["username"]; ?>"><input type="hidden" name="fullname" value="<?php echo $_POST["fullname"]; ?>"><input type="hidden" name="email" value="<?php echo $_POST["email"]; ?>"><input type="hidden" name="password" value="<?php echo $_POST["password"]; ?>"><input type="hidden" name="password2" value="<?php echo $_POST["password2"]; ?>"><input type="hidden" name="producturl" value="<?php echo $_POST["producturl"]; ?>"><input type="hidden" name="companyname" value="<?php echo $_POST["companyname"]; ?>"><?php
						}
					}
					

					?>
							<script type="text/javascript" language="javascript">
							<!--

								<?php
								if ((trim($_SWIFT["execmodule"]) != "" && $_POST["step"] == "3" && SETUPTYPE == "Setup") || ($_POST["step"] == "2" && SETUPTYPE == "Upgrade") || ($_POST["step"] == "2" && SETUPTYPE == "Impex") || ($_REQUEST["step"] == "2" && SETUPTYPE == "Modify" && $_SWIFT["processbuttons"] == true))
								{
									?>
									function docLoaded()
									{
										document.setupform.submitbutton.value = "Please wait.. Redirecting..";
										document.setupform.submitbutton.disabled = true;
										setTimeout("submitForm();", "<?if (SETUPTYPE == "Impex") { echo "2000"; } else { echo "5000"; }?>");
									}
									<?
									if ($_SWIFT["setupfailed"] != true)
									{
									?>
							function submitForm()
							{
									document.setupform.submit();
							}
								<?php
									}
								} else {
									?>
									function docLoaded()
									{
									}
									<?
								}
								?>
							-->
							</script>

					</td>
                  </tr>
                </table></td>
              </tr>
          </table></td>
        </tr>
	  <tr>
		<td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td height="5" bgcolor="#E1E1E1"><img src="space.gif" width="1" height="5"></td>
		  </tr>
		  <tr>
			<td height="8" bgcolor="#707070"><table width="100%"  border="0" cellspacing="0" cellpadding="2">
			  <tr>
				<td align="left"><span class="gtext"><font color="#EFEFEF">Copyright &copy; 2001-<?=date("Y");?> Kayako Infotech Ltd. </font></span></td>
				<td width="1" align="right"><img src="space.gif" width="1" height="15"></td>
			  </tr>
			</table></td>
		  </tr>
		  <tr>
			<td height="2" bgcolor="#4E4E4E"><img src="space.gif" width="1" height="2"></td>
		  </tr>
		</table></td>
	  </tr>
      </table>
    </form>
	</td>
  </tr>
</table>
</body>
</html>
